package com.atgm.mall.gmmallclub.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName("club_article")
public class ArticleEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    /**
     * 文章标题
     */
    private String articleTitle;

    /**
     * 默认图片
     */
    private String defImg;

    /**
     * 文章内容
     */
    private String contentHtml;

    /**
     * 标签
     */
    private String tag;

    /**
     * 用户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    /**
     * 浏览数量
     */
    private Integer viewCount;

    /**
     * 点赞数量
     */
    private Integer thumbsCount;

    /**
     * 评论数量
     */
    private Integer commentCount;
    /**
     * 收藏数量
     */
    private Integer collectCount;

    /**
     * 是否发布：0；否，保存；1：发布
     */
    private Integer isPublish;
    /**
     * 是否删除：0：否；1：是
     */
    @TableLogic
    private Integer deleted;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;
}
